#pragma once

#include "ActorComponent.h"

#include "..\Math\Matrix4x4.h"

class TransformComponent : public ActorComponent
{
    Matrix4x4 m_transform;

	public:
		static const char* g_Name;
		virtual const char* VGetName() const { return g_Name; }

		TransformComponent() : m_transform(Matrix4x4::Identity) { }
		virtual bool VInit(TiXmlElement* pData) override;
		virtual TiXmlElement* VGenerateXml(void) override;

		// transform functions
		Matrix4x4 GetTransform(void) const { return m_transform; }
		void SetTransform(const Matrix4x4& newTransform) { m_transform = newTransform; }
		Vector3 GetPosition(void) const { return m_transform.GetPosition(); }
		void SetPosition(const Vector3& pos) { m_transform.SetPosition(pos); }
		Vector3 GetLookAt(void) const { return m_transform.GetDirection(); }
};